package com.pheonix.fbupdates;

import org.joda.time.DateTime;

import android.app.Dialog;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import android.support.v4.app.Fragment;

public class EventFragment extends Fragment {
	
	private String eventTitle;
	private String eventLocation;
	private DateTime eventStartTime;
	private DateTime eventEndTime;
	
	@Override
	public void setArguments(Bundle bundle) {
		this.eventTitle = bundle.getString("eventTitle", "Unspecified");
		this.eventLocation = bundle.getString("eventLocation", "Unspecified");
		this.eventStartTime = new DateTime(bundle.getString("eventStartTime", "Unspecified"));
		this.eventEndTime = new DateTime(bundle.getString("eventEndTime", "Unspecified"));
	}
	
	@Override
	public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
		
		super.onCreateView(inflater, container, savedInstanceState);
		
		View view = inflater.inflate(R.layout.fragment_event, container, false);
		
		TextView title = (TextView) view.findViewById(R.id.eventTitle);
		TextView location = (TextView) view.findViewById(R.id.eventLocation);
		
		title.setText(eventTitle);
		location.setText(eventLocation);
		
		return view;
	}

}
